package com.util;

public class Regex
{ 
	/*
	 * E-mail check
	 */
	public static boolean checkEmail(String value)
	{
		return value.matches("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
	}
	public static boolean checkName(String value)
	{
		return value.matches("^[A-Za-z]+$");
	}
	public static boolean checkUserID(String value)
	{
		return value.matches("^\\d+$");
	}
	public static boolean checkAdminID(String value)
	{
		return value.matches("^\\d+$");
	}
	public static boolean checkPhone(String value)
	{
		return value.matches("^\\d+$");
	}
	public static boolean checkAge(String value)
	{
		return value.matches("^(?:[1-9][0-9]?|1[01][0-9]|120)$");
	}

	public static boolean checkDays(String value)
	{
		return value.matches("^([1-9]|[1-9]\\d|100)$");
	}
	public static boolean checkprice(String value)
	{
		return value.matches("^\\d+(\\.\\d\\d)?$");
	}
	public static boolean checkBarcode(String value)
	{
		return value.matches("^\\d+$");
	}
	public static boolean checkInsName(String value)
	{
		return value.matches("^[A-Za-z0-9]+$");
	}
	public static boolean checkRecordID(String value)
	{
		return value.matches("^[1-9]\\d*$");
	}
	public static boolean checkDate(String value)
	{
		return value.matches("^((((19|20)\\d{2})-(0?(1|[3-9])|1[012])-(0?[1-9]|[12]\\d|30))|(((19|20)\\d{2})-(0?[13578]|1[02])-31)|(((19|20)\\d{2})-0?2-(0?[1-9]|1\\d|2[0-8]))|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))-0?2-29))$");
	}
	
}
